<!DOCTYPE html>
<html>
<head>
    <title>时间文本框生成器</title>
</head>
<body>
    <button onclick="addTimeField()">添加当前时间</button>
    <div id="container"></div>

    <script>
        function addTimeField() {
            // 创建新的输入框
            const input = document.createElement('input');
            input.type = 'text';
            input.readOnly = true;
            
            // 获取当前时间并格式化
            const now = new Date();
            const timeString = now.toLocaleTimeString('en-US', { 
                hour12: false,
                hour: '2-digit',
                minute: '2-digit',
                second: '2-digit'
            });
            
            // 设置输入框的值
            input.value = timeString;
            
            // 添加到页面
            document.getElementById('container').appendChild(input);
            document.getElementById('container').appendChild(document.createElement('br'));
        }
    </script>
</body>
</html>